const faker = require('faker');

faker.locale = 'zh_CN';

const crsTypeSelect = [{ value: 0, name: '类别0' }, { value: 1, name: '类别1' }];
const crsFormSelect = [{ value: 0, name: '线上自学' }, { value: 1, name: '线上直播' }, { value: 2, name: '线下' }];
const agencySelect = [{ value: 0, name: '培训机构0' }, { value: 1, name: '培训机构1' }];
const teacherSelect = [{ value: 0, name: '王晓天' }, { value: 1, name: '董京国' }];
const assignerSelect = [{ value: 0, name: '刘会瓦' }, { value: 1, name: '林栋梁' }];
// 课程列表
const courseList = [];
for (let i = 0; i < 20; i++) {
  courseList.push({
    id: faker.random.uuid(),
    code: faker.random.uuid(),
    name: faker.name.title(),
    type: Math.floor(Math.random() * 2),
    form: Math.floor(Math.random() * 3),
    trainAgency: Math.floor(Math.random() * 2),
    creator: Math.floor(Math.random() * 2),
    createTime: Date.now(),
    assess: faker.random.number(1),
    status: faker.random.number(1)
  });
}

// 左侧目录数据
const treeData = [{
  id: '1',
  name: '全部',
  children: [{
    id: '1-1',
    name: '文件夹A',
    children: [{
      id: '1-1-1',
      name: '子类A1'
    }, {
      id: '1-1-2',
      name: '子类A2'
    }]
  }, {
    id: '1-4',
    name: '文件夹B',
    children: [{
      id: '1-4-1',
      name: '子类B1'
    }, {
      id: '1-4-2',
      name: '子类B2'
    }]
  }, {
    id: '1-6',
    name: '文件夹C',
    children: [{
      id: '1-6-1',
      name: '子类C1'
    }, {
      id: '1-6-2',
      name: '子类C2'
    }]
  }]
}];

// 培训机构列表
const trainAgencyList = [];
for (let i = 0; i < 16; i++) {
  trainAgencyList.push({
    id: faker.random.uuid(),
    agCode: faker.random.uuid(),
    agName: faker.name.title(),
    agDesc: faker.company.companyName(),
    agAddress: faker.company.companySuffix(),
    agContacts: faker.random.number(1),
    agContactNumber: faker.random.number(9999999),
    agClassNumber: faker.random.number(99),
    agTeacherNumber: faker.random.number(99),
    status: faker.random.number(1)
  });
}

// 培训计划列表
const trainPlanList = [];
for (let i = 0; i < 16; i++) {
  trainPlanList.push({
    id: faker.random.uuid(),
    courseCode: faker.random.uuid(),
    courseName: faker.name.title(),
    courseDesc: faker.company.companyName(),
    courseCount: faker.random.number(8),
    courseCreator: Math.floor(Math.random() * 8),
    courseCreatTime: Date.now(),
    status: faker.random.number(1),
    avail: faker.random.number(1)
  });
}

// 培训证书列表
const trainCredentialList = [];
for (let i = 0; i < 16; i++) {
  trainCredentialList.push({
    id: faker.random.uuid(),
    code: faker.random.uuid(),
    name: faker.name.title(),
    url: faker.random.image(),
    desc: faker.company.companyName(),
    count: faker.random.number(9),
    awardAgency: faker.random.number(2),
    validity: Date.now(),
    creator: faker.random.number(2),
    courseCreatTime: Date.now(),
    avail: faker.random.number(1)
  });
}

// 人员列表
const staffList = [];
for (let i = 0; i < 16; i++) {
  staffList.push({
    id: faker.random.uuid(),
    name: faker.name.lastName(),
    post: faker.name.jobTitle(),
    department: faker.company.companyName(),
    function: faker.name.jobType(),
  });
}

export default {
  crsTypeSelect,
  crsFormSelect,
  agencySelect,
  teacherSelect,
  assignerSelect,
  trainAgencyList,
  courseList,
  treeData,
  trainPlanList,
  trainCredentialList,
  staffList
};
